

(function () {
  var currentIndex = '';
  var last = '';
  var arr = [
    {title: '虚拟仿真', desc: '真实还原生产过程，如同身临其境；3D漫游、逼真呈现;交互式体验、沉浸其中、真实还原操作流程'},
    {title: '透明化生产', desc: '模拟车间设备和生产状况，使企业对车间设备状况和加工信息一目了然。并且及时将管控指令下发车间，实时反馈执行状态，提高车间的透明化'},
    {title: '安全仿真', desc: '无需现场操作即可体验逼真的安全实景模拟训练，降低高危操作风险'},
    {title: '营销利器', desc: '结合VR眼镜、游戏鼠标等操作方式，游乐化展示给任何地方的客户；更加直观、清晰产品的详细信息'},
  ];
  $('.text-box-right li').mouseenter(function () {
    li = $(this);
    var index = $(this).index();
    currentIndex = $(this).css('z-index');
    $(this).addClass('hover').css({zIndex: 99}).siblings().removeClass('hover');
    $('.text-box .title').text(arr[index].title);
    $('.text-box .title-desc').text(arr[index].desc);
  })
  $('.text-box-right li').mouseleave(function () {
    $(this).css({zIndex: currentIndex});
  })

//  video

  $('.playBtn').click(function () {
    $(this).hide();
    $('.video')[0].play();
    $('.video').attr('controls','controls')
  })

  //头部二维码
  $('.small-erwei').mouseenter(function () {
    $('.show-big-erwei').css({width: '172px', height: '171px'});
  })
  $('.small-erwei').mouseleave(function () {
    $('.show-big-erwei').css({width: '0px', height: '0px'});
  })

  //form 提交

  $('.bottom-submit').click(function (e) {
    e.preventDefault();
    // console.log(
    //     $('#form').serialize()
    // );
    $.ajax({
      url:'',
      type:'post',
      data:$('#form').serialize(),
      success:function (data) {
        //你们来做判断
      }
    })
  })


})();


(function () {
  var gotTopBtn = document.getElementsByClassName('goTop')[0];
  gotTopBtn.onclick = function () {
    gotoTop(4)
  }

  //平滑返回顶部
  function gotoTop(rate) {

    if (!window.requestAnimationFrame) {
      requestAnimationFrame = function (fn) {
        setTimeout(fn, 17);
      };
    }

    var doc = document.body.scrollTop ? document.body : document.documentElement;
    var scrollTop = doc.scrollTop;
    var top = function () {
      scrollTop = scrollTop + (0 - scrollTop) / (rate || 2);
      if (scrollTop < 1) {
        doc.scrollTop = 0;
        return false;
      }
      doc.scrollTop = scrollTop;
      stop = requestAnimationFrame(top);
    };
    top();
  }
})();
